package com.groupexercises.controller;

import com.groupexercises.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * --- 代码敲对！ ---
 *
 * @author CCCccc
 * @create 2025/8/6
 * 备注：控制层，实现与用户相关的各类操作
 */
@Controller
public class UserController {
    @Autowired
    private UserService userService;
    // TODO: 2025/8/6 1.用户登录
    @PostMapping("/login")
    public String login(){

        // 调用UserService中的login方法
        userService.login();
        // 跳转到home页面
        return "home.html";

    }

}
